﻿Imports System
Imports System.IO
Imports System.Drawing
Imports System.Drawing.Font
Imports System.Collections
Imports System.ComponentModel
Imports System.Windows.Forms
Imports System.Data
Imports System.Drawing.Text
Imports System.Xml

Public Class CodigoBarraSet


    Public Shared fuente As Font
    Public Shared directorioFuentes As String = "C:\Windows\Fonts"

    Public Shared Function CargarListaFuentes()
        Try
            Dim Directorio As DirectoryInfo
            Directorio = New DirectoryInfo(directorioFuentes)

        Catch ex As Exception
            MessageBox.Show(ex.Message)
        End Try
        Return True
    End Function





    Public Shared Function CargarFuente(ByVal _fuente As String)
        Dim pfc As PrivateFontCollection = New PrivateFontCollection()
        Dim fontFamily As FontFamily

        pfc.AddFontFile(directorioFuentes & "\" & _fuente)
        fontFamily = pfc.Families(0)
        fuente = New Font(fontFamily, 30)
        Return True
    End Function





    Public Shared Function FormatoCodigoBarras(ByVal code As String) As String
        Dim barcode As String = String.Empty
        barcode = String.Format("{0}", code)
        Return barcode
    End Function


    'Public Shared Function generacodigo(ByVal ida as)
    '    Try
    '        If txtcodigo.Text = String.Empty Then
    '            lblcodigo.Text = "Tienes que introducir un Código"
    '        Else
    '            If Not (fuente Is Nothing) Then
    '                lblcodigo.Font = fuente
    '                lblcodigo.text = FormatoCodigoBarras(txtcodigo.Text)
    '                lblcode.Text = FormatoCodigoBarras(txtcodigo.Text)

    '            End If
    '        End If
    '    Catch ex As Exception
    '        MessageBox.Show(ex.Message)
    '    End Try


End Class
